package com.zp.drug.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zp.common.core.entity.BaseEntity;
import com.zp.common.satoken.utils.LoginHelper;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;


/**
 * 处方权限配置对象 drug_pres_permissions_conf
 *
 * @author zhang peng
 * @ date 2023-06-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("drug_pres_permissions_conf")
public class DrugPresPermissionsConf extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "permissions_conf_id")
    private String permissionsConfId;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 毒理分类  DRUG_TOXI_PROPERTY_DICT字典值
     */
    private String toxiProperty;

    /**
     * 限制等级  LIMIT_CLASS_DICT字典值
     */
    private String limitClass;

    /**
     * 组织机构ID
     */
    private String orgId;

    /**
     * 删除标志
     */
    @TableLogic
    private String delFlag;
    /**
     * 备注信息
     */
    private String remarks;

    public void initEntity () {
        this.delFlag = "0";
    }

    /**
     * 修改人、修改时间信息信息
     */
    public void updateInfo () {
        setUpdateBy(LoginHelper.getLoginUser().getNickName());
        setUpdateTime(new Date());
    }

}
